package com.xawl.service.impl;

import com.xawl.dao.CourseMapper;
import com.xawl.pojo.CourseLearning;
import com.xawl.service.CourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CourseServiceImpl implements CourseService {

    @Autowired
    CourseMapper courseMapper;

    public Integer getTotal() {
        return courseMapper.getTotal();
    }

    public int addCourse(CourseLearning cl) {
        return courseMapper.addCourse(cl);
    }

    public int deleteCourse(int id) {
        return courseMapper.deleteCourse(id);
    }

    @Override
    public int deleteCourses(Long[] ids) {
        return courseMapper.deleteCourses(ids);
    }

    @Override
    public CourseLearning findCourseById(int id) {
        return courseMapper.findCourseById(id);
    }

    @Override
    public List<CourseLearning> queryAll() {
        return courseMapper.queryAll();
    }

    public int updateCourse(CourseLearning cl) {
        return courseMapper.updateCourse(cl);
    }

}
